

package com.hazelcast.spi.exception;

/**
 * Exception to indicate any issues while executing a REST call.
 */
public class RestClientException extends RuntimeException {
    private final int httpErrorCode;

    public RestClientException(String message, int httpErrorCode) {
        super(String.format("%s. HTTP Error Code: %s", message, httpErrorCode));
        this.httpErrorCode = httpErrorCode;
    }

    public RestClientException(String message, Throwable cause) {
        super(message, cause);
        httpErrorCode = 0;
    }

    public int getHttpErrorCode() {
        return httpErrorCode;
    }
}
